local Util   = Priceless.Util
local Player = Priceless.Player

local Mat = Priceless.Item.Mat
local Mote = Mat.Mote

local Data = {}

Data.Mote = {
	[Mote.Air]    = { name = 'Mote of Air' },
	[Mote.Earth]  = { name = 'Mote of Earth' },
	[Mote.Fire]   = { name = 'Mote of Fire' },
	[Mote.Life]   = { name = 'Mote of Life' },
	[Mote.Mana]   = { name = 'Mote of Mana' },
	[Mote.Shadow] = { name = 'Mote of Shadow' },
	[Mote.Water]  = { name = 'Mote of Water' },
}

Data.Mob = {
	['Aqueous Lord'] =                 { [Mote.Water]  =     74/    284 },
	['Aqueous Spawn'] =                { [Mote.Water]  =    226/    818 },
	['Bloodscale Elemental'] =         { [Mote.Water]  =     97/    523 },
	['Crashing Wave-Spirit'] =         { [Mote.Water]  =  77309/ 227404 },
	['Darkcrest Sentry'] =             { [Mote.Water]  =   1170/   6942 },
	['Enraged Water Spirit'] =         { [Mote.Water]  =  22485/  87083 },
	['Lake Spirit'] =                  { [Mote.Water]  =  32490/ 171340 },
	['Lake Surger'] =                  { [Mote.Water]  =  15117/  79666 },
	['Muck Spawn'] =                   { [Mote.Water]  =  27487/ 145125 },
	['Skettis Surger'] =               { [Mote.Water]  = 131953/ 388156 },
	['Steam Surger'] =                 { [Mote.Water]  =  11667/  40008 },
	['Tidal Surger'] =                 { [Mote.Water]  =   3193/  11827 },
	['Watoosun\'s Polluted Essence'] = { [Mote.Water]  =   1279/   4849 },

	['Storming Wind-Ripper'] =         { [Mote.Air]    = 102003/ 299989 },
	['Enraged Air Spirit'] =           { [Mote.Air]    = 126273/ 490058 },
	['Storm Rager'] =                  { [Mote.Air]    =  18136/  97129 },
	['Dust Howler'] =                  { [Mote.Air]    =  12625/  68358 },
	['Living Cyclone'] =               { [Mote.Air]    =   6517/  35650 },

	['Raging Fire-Soul'] =             { [Mote.Fire]   = 121892/ 358779 },
	['Vile Fire-Soul'] =               { [Mote.Fire]   =  24790/  73063 },
	['Fel Rager'] =                    { [Mote.Fire]   =  13298/  39905 },
	['Enraged Fire Spirit'] =          { [Mote.Fire]   =  81810/ 317317 },
	['Searing Elemental'] =            { [Mote.Fire]   =  95002/ 370053 },

	['Rotting Forest-Rager'] =         { [Mote.Life]   =   2952/   3545 },
	['Bog Overlord'] =                 { [Mote.Life]   =   4356/  17313 },
	['Fungal Giant'] =                 { [Mote.Life]   =  25634/ 135927 },
	['Infested Root-Walker'] =         { [Mote.Life]   =  14373/  76229 },
	['Withered Giant'] =               { [Mote.Life]   =  38715/ 207745 },
	['Starving Fungal Giant'] =        { [Mote.Life]   =  26906/ 144957 },
	['Lagoon Walker'] =                { [Mote.Life]   =   1067/   5780 },
	['Withered Bog Lord'] =            { [Mote.Life]   =  24293/ 131781 },
	['Bog Lord'] =                     { [Mote.Life]   =  11338/  61536 },
	['Starving Bog Lord'] =            { [Mote.Life]   =   9500/  51955 },
	['Bog Giant'] =                    { [Mote.Life]   =   5682/  31532 },
	['Underbog Shambler'] =            { [Mote.Life]   =   2478/  13825 },
	['Underbog Lurker'] =              { [Mote.Life]   =   5213/  29168 },
	['Underbog Lord'] =                { [Mote.Life]   =   1299/   7394 },
	['Marsh Baron Brok'] =             { [Mote.Life]   =     75/    463 },
	['Hungarfen'] =                    { [Mote.Life]   =    853/  12312 },
	['Underbog Colossus'] =            { [Mote.Life]   =    201/   4212 },
	['Talonsworn Forest-Rager'] =      { [Mote.Life]   =    278/  17831 },

	['Sundered Thunderer'] =           { [Mote.Earth]  =   1496/   7596 },
	['Sundered Rumbler'] =             { [Mote.Earth]  =   8080/  43359 },
	['Shattered Rumbler'] =            { [Mote.Earth]  =  10455/  56495 },
	['Enraged Earth Spirit'] =         { [Mote.Earth]  =  13269/  71982 },
	['Rumbling Earth-Heart'] =         { [Mote.Earth]  =   5546/  33975 },
	['Tortured Earth Spirit'] =        { [Mote.Earth]  =  14014/  99831 },
	['Enraged Crusher'] =              { [Mote.Earth]  =  13912/ 102486 },

	['Unbound Ethereal'] =             { [Mote.Mana]   =  13512/  40584 },
	['Aether Ray'] =                   { [Mote.Mana]   =   9527/  28826 },
	['Magical Horror'] =               { [Mote.Mana]   =   3408/  12258 },
	['Mana Warp'] =                    { [Mote.Mana]   =   6957/  25135 },
	['Arcane Anomaly'] =               { [Mote.Mana]   =   5347/  19714 },
	['Chaotic Sentience'] =            { [Mote.Mana]   =   1203/   4453 },
	['Mana Feeder'] =                  { [Mote.Mana]   =  12618/  46888 },
	['Syphoner'] =                     { [Mote.Mana]   =  27162/ 101387 },
	['Mageslayer'] =                   { [Mote.Mana]   =  61287/ 235873 },
	['Mana Wraith'] =                  { [Mote.Mana]   =  63555/ 247235 },
	['Mana Seeker'] =                  { [Mote.Mana]   = 114771/ 446987 },
	['Nether Ray'] =                   { [Mote.Mana]   =  22028/  85801 },
	['Phase Hunter'] =                 { [Mote.Mana]   =  39882/ 156150 },
	['Mana Snapper'] =                 { [Mote.Mana]   =   8760/  34330 },
	['Netherskate'] =                  { [Mote.Mana]   =  13103/  51361 },
	['Netherwing Ray'] =               { [Mote.Mana]   =  15526/  60900 },
	['Drained Phase Hunter'] =         { [Mote.Mana]   =   8944/  35623 },
	['Warp Aberration'] =              { [Mote.Mana]   =   5574/  22203 },
	['Warp Monstrosity'] =             { [Mote.Mana]   =   9232/  36877 },
	['Ever-Core the Punisher'] =       { [Mote.Mana]   =     88/    352 },
	['Netherspite'] =                  { [Mote.Mana]   =    368/   4022 },
	['Mana Invader'] =                 { [Mote.Mana]   =      2/     30 },

	['Infernal Soul'] =                { [Mote.Shadow] =   1140/   1401 },
	['Eye of Culuthas'] =              { [Mote.Shadow] =   3352/   4184 },
	['Cooling Infernal'] =             { [Mote.Shadow] =    653/    818 },
	['Hound of Culuthas'] =            { [Mote.Shadow] =   7780/   9791 },
	['Dimensius the All-Devouring'] =  { [Mote.Shadow] =    297/    474 },
	['Throne Hound'] =                 { [Mote.Shadow] =    105/    185 },
	['Gargantuan Abyssal'] =           { [Mote.Shadow] =    985/   2395 },
	['Artifact Seeker'] =              { [Mote.Shadow] =  28163/  69914 },
	['Nightmare Imp'] =                { [Mote.Shadow] =    144/    366 },
	['Darkflame Infernal'] =           { [Mote.Shadow] =    200/    580 },
	['Fear Whisperer'] =               { [Mote.Shadow] =   2687/   7954 },
	['Wrath Fiend'] =                  { [Mote.Shadow] =    162/    517 },
	['Negaton Warp-Master'] =          { [Mote.Shadow] =   2638/   8447 },
	['Nightmare Weaver'] =             { [Mote.Shadow] =     59/    189 },
	['Negaton Screamer'] =             { [Mote.Shadow] =   2624/   8492 },
	['Voidhunter Yar'] =               { [Mote.Shadow] =     59/    201 },
	['Arconus the Insatiable'] =       { [Mote.Shadow] =    905/   3402 },
	['Fel Reaver'] =                   { [Mote.Shadow] =    365/   1462 },
	['Nethervine Trickster'] =         { [Mote.Shadow] =   2428/   9866 },
	['Felguard Brute'] =               { [Mote.Shadow] =   2497/  12070 },
	['Mechanar Crusher'] =             { [Mote.Shadow] =    617/   3006 },
	['Malicious Instructor'] =         { [Mote.Shadow] =   6498/  32112 },
	['Deathforge Automaton'] =         { [Mote.Shadow] =     92/    455 },
	['Blazing Trickster'] =            { [Mote.Shadow] =    272/   1350 },
	['Wrath Lord'] =                   { [Mote.Shadow] =   7393/  36858 },
	['Nethervine Reaper'] =            { [Mote.Shadow] =   2937/  14760 },
	['Mechanar Driller'] =             { [Mote.Shadow] =   3625/  18442 },
	['Nethervine Inciter'] =           { [Mote.Shadow] =   4602/  23644 },
	['Fel Overseer'] =                 { [Mote.Shadow] =   7016/  36135 },
	['Hatecryer'] =                    { [Mote.Shadow] =   2274/  11885 },
	['Nexus Terror'] =                 { [Mote.Shadow] =   3826/  20190 },
	['Mechanar Wrecker'] =             { [Mote.Shadow] =   3885/  20521 },
	['Voidspawn'] =                    { [Mote.Shadow] =  22381/ 120003 },
	['Vacillating Voidcaller'] =       { [Mote.Shadow] =   3611/  19384 },
	['Void Terror'] =                  { [Mote.Shadow] =   1344/   7260 },
	['Collapsing Voidwalker'] =        { [Mote.Shadow] =   8851/  47817 },
	['Cyber-Rage Forgelord'] =         { [Mote.Shadow] =   5500/  30034 },
	['Eredar Soul-Eater'] =            { [Mote.Shadow] =    931/   5093 },
	['Deathforge Tinkerer'] =          { [Mote.Shadow] =   6200/  33936 },
	['Mo\'arg Weaponsmith'] =          { [Mote.Shadow] =  16125/  88344 },
	['Prophetess Cavrylin'] =          { [Mote.Shadow] =    902/   4942 },
	['Felblade Doomguard'] =           { [Mote.Shadow] =   9448/  52070 },
	['Ironspine Forgelord'] =          { [Mote.Shadow] =   1692/   9335 },
	['Subjugator Vaz\'shir'] =         { [Mote.Shadow] =    281/   1551 },
	['Wrathwalker'] =                  { [Mote.Shadow] =  46466/ 258227 },
	['Terrormaster'] =                 { [Mote.Shadow] =  10832/  60202 },
	['Illidari Satyr'] =               { [Mote.Shadow] =   1486/   8306 },
	['Concubine'] =                    { [Mote.Shadow] =   1327/   7455 },
	['Mo\'arg Doomsmith'] =            { [Mote.Shadow] =   4658/  26415 },
	['Unbound Devastator'] =           { [Mote.Shadow] =    838/   4754 },
	['Doomcryer'] =                    { [Mote.Shadow] =    455/   2598 },
	['Illidari Shocktrooper'] =        { [Mote.Shadow] =   6042/  34674 },
	['Doomforge Attendant'] =          { [Mote.Shadow] =   6604/  37964 },
	['Illidari Shadowstalker'] =       { [Mote.Shadow] =   3507/  20181 },
	['Illidari Dreadbringer'] =        { [Mote.Shadow] =   1228/   7094 },
	['Skulking Witch'] =               { [Mote.Shadow] =   1126/   6529 },
	['Terrorguard'] =                  { [Mote.Shadow] =   2340/  13591 },
	['Felguard Legionnaire'] =         { [Mote.Shadow] =    992/   5768 },
	['Warp-Gate Engineer'] =           { [Mote.Shadow] =   1335/   7779 },
	['Terrorguard Protector'] =        { [Mote.Shadow] =   5220/  30492 },
	['Overseer Ripsaw'] =              { [Mote.Shadow] =   1859/  10860 },
	['Mo\'arg Warp-Master'] =          { [Mote.Shadow] =   5453/  32080 },
	['Spiteful Temptress'] =           { [Mote.Shadow] =    840/   4942 },
	['Painmistress Gabrissa'] =        { [Mote.Shadow] =    614/   3616 },
	['Death\'s Might'] =               { [Mote.Shadow] =  20612/ 121598 },
	['Illidari Painlasher'] =          { [Mote.Shadow] =   2475/  14610 },
	['Baelmon the Hound-Master'] =     { [Mote.Shadow] =    460/   2722 },
	['Doomforge Engineer'] =           { [Mote.Shadow] =   6144/  36448 },
	['Deathforge Smith'] =             { [Mote.Shadow] =   3172/  18869 },
	['Zandras'] =                      { [Mote.Shadow] =    472/   2821 },
	['Pentatharon'] =                  { [Mote.Shadow] =   1356/   8114 },
	['Unchained Doombringer'] =        { [Mote.Shadow] =    965/   5781 },
	['Sargeron Hellcaller'] =          { [Mote.Shadow] =    951/   5745 },
	['Deathforge Over-Smith'] =        { [Mote.Shadow] =   3470/  20991 },
	['Overmaster Grindgarr'] =         { [Mote.Shadow] =    528/   3221 },
	['Sargeron Archer'] =              { [Mote.Shadow] =    911/   5558 },
	['Illidari Overseer'] =            { [Mote.Shadow] =   2743/  16764 },
	['Eredar Deathbringer'] =          { [Mote.Shadow] =    827/   5075 },
	['Death Watcher'] =                { [Mote.Shadow] =   1498/   9290 },
	['Scorch Imp'] =                   { [Mote.Shadow] =  11652/  72377 },
	['Entropic Eye'] =                 { [Mote.Shadow] =   1344/   8375 },
	['Doomclaw'] =                     { [Mote.Shadow] =    700/   4411 },
	['Veneratus the Many'] =           { [Mote.Shadow] =    531/   3372 },
	['Homunculus'] =                   { [Mote.Shadow] =   2744/  18097 },
	['Anger Guard'] =                  { [Mote.Shadow] =   5832/  38504 },
	['Deathforge Technician'] =        { [Mote.Shadow] =  10295/  68641 },
	['Spawn of Uvuros'] =              { [Mote.Shadow] =   1709/  11423 },
	['Illidari Jailor'] =              { [Mote.Shadow] =    522/   3519 },
	['Mechanar Tinkerer'] =            { [Mote.Shadow] =   8174/  56585 },
	['Dreadwarden'] =                  { [Mote.Shadow] =    830/   5794 },
	['Dark Worg'] =                    { [Mote.Shadow] =    329/   2403 },
	['Mo\'arg Engineer'] =             { [Mote.Shadow] =   1127/   8430 },
	['Fel Corrupter'] =                { [Mote.Shadow] =   1841/  13840 },
	['Culuthas'] =                     { [Mote.Shadow] =    516/   3941 },
	['Mistress of Doom'] =             { [Mote.Shadow] =   1518/  11609 },
	['Warbringer Razuun'] =            { [Mote.Shadow] =    353/   2700 },
	['Arzeth the Powerless'] =         { [Mote.Shadow] =    534/   4125 },
	['Arazzius the Cruel'] =           { [Mote.Shadow] =    363/   2812 },
	['Terrorfiend'] =                  { [Mote.Shadow] =  12067/  93546 },
	['Forgemaster Morug'] =            { [Mote.Shadow] =    340/   2656 },
	['Felguard Destroyer'] =           { [Mote.Shadow] =    267/   2102 },
	['Gan\'arg Tinkerer'] =            { [Mote.Shadow] =   4657/  36716 },
	['Mo\'arg Forgefiend'] =           { [Mote.Shadow] =   2057/  16267 },
	['Razorsaw'] =                     { [Mote.Shadow] =   1080/   8542 },
	['Sister of Grief'] =              { [Mote.Shadow] =   4401/  34925 },
	['Makazradon'] =                   { [Mote.Shadow] =    309/   2473 },
	['Felguard Annihilator'] =         { [Mote.Shadow] =   2150/  17870 },
	['Silroth'] =                      { [Mote.Shadow] =    315/   2697 },
	['Warbringer Arix\'Amal'] =        { [Mote.Shadow] =    732/   6592 },
	['Morgroron'] =                    { [Mote.Shadow] =    284/   2611 },
	['Uncontrolled Voidwalker'] =      { [Mote.Shadow] =   6310/  59147 },
	['Rogue Voidwalker'] =             { [Mote.Shadow] =   6152/  58265 },
	['Levixus'] =                      { [Mote.Shadow] =    328/   3225 },
	['Zereketh the Unbound'] =         { [Mote.Shadow] =    874/   8709 },
	['Unstable Voidwraith'] =          { [Mote.Shadow] =   4990/  52216 },
	['Voidshrieker'] =                 { [Mote.Shadow] =   4850/  52146 },
	['Mo\'arg Master Planner'] =       { [Mote.Shadow] =    375/   4213 },
	['Demos, Overseer of Hate'] =      { [Mote.Shadow] =    313/   3666 },
	['Xirkos, Overseer of Fear'] =     { [Mote.Shadow] =    279/   3413 },
	['Abyssal Flamebringer'] =         { [Mote.Shadow] =   5219/  65168 },
	['Wrath Speaker'] =                { [Mote.Shadow] =   3248/  40877 },
	['Gatewatcher Gyro-Kill'] =        { [Mote.Shadow] =   1248/  19040 },
	['Gatewatcher Iron-Hand'] =        { [Mote.Shadow] =   1227/  19232 },
	['Dalliah the Doomsayer'] =        { [Mote.Shadow] =    550/   8793 },
	['Pandemonius'] =                  { [Mote.Shadow] =    734/  12311 },
	['Wrath-Scryer Soccothrates'] =    { [Mote.Shadow] =    475/   8200 },
	['Nethermancer Sepethrea'] =       { [Mote.Shadow] =    985/  17669 },
	['Ambassador Hellmaw'] =           { [Mote.Shadow] =   1615/  31860 },
	['Mechano-Lord Capacitus'] =       { [Mote.Shadow] =   1138/  24115 },
	['Prince Malchezaar'] =            { [Mote.Shadow] =    380/   8124 },
	['Terestian Illhoof'] =            { [Mote.Shadow] =    231/   5229 },
	['Pathaleon the Calculator'] =     { [Mote.Shadow] =   1078/  30254 },
	['Illidari Agonizer'] =            { [Mote.Shadow] =    378/  11738 },
	['Omor the Unscarred'] =           { [Mote.Shadow] =    590/  18493 },
	['Deathforge Imp'] =               { [Mote.Shadow] =   1121/  35389 },
	['Crystalcore Mechanic'] =         { [Mote.Shadow] =     51/   2496 },

	['Angered Nether-wraith'] =        { [Mote.Fire]   =  11099/  11122,   [Mote.Mana]   =   11056/  11122 },
	['Bloodscale Sentry'] =            { [Mote.Water]  =   1166/   8274,   [Mote.Mana]   =     185/   8274 },
	['Bloodthirsty Marshfang'] =       { [Mote.Water]  =   3810/  24410,   [Mote.Mana]   =     752/  24410 },
	['Lagoon Eel'] =                   { [Mote.Water]  =   1409/   9884,   [Mote.Mana]   =     431/   9884 },
	['Shimmerscale Eel'] =             { [Mote.Water]  =  59086/ 323692,   [Mote.Mana]   =    2250/ 323692 },

}

local Code = {}

function Code:OnTooltipSetUnit(tooltip, name)
	local data = Data.Mob[name]
	if not Util:isTable(data) then return end

	Util:AddToTooltip('Valuable drops:')
	for dropId, dropRate in pairs(data) do
		local dropData = Data.Mote[dropId]
		Util:AddToTooltip(' - '.. dropData.name:white(), math.as_percent(dropRate))
	end
end

Priceless:AddMod('Drops', Code)
